<script>
  import {Collapse} from "sveltestrap/src";
  export let isOpen = false;
  export let title = 'pages';
  export let icon = 'fa-folder';
</script>

<li class="nav-item">
  <button
    on:click={() => (isOpen = !isOpen)}
    data-toggle=collapse
    class="nest-nav btn nav-link {isOpen?'':'collapsed'}"
  >
    <i class="fas fa-fw {icon}" />
    <span>{title}</span>
  </button>
  <Collapse
    {isOpen}
    class="collapse show"
  >
    <slot></slot>
  </Collapse>
</li>